<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>询问窗口</title>
    <script type="text/javascript">
        function method01(){
            var result=window.prompt('请输入你的姓名?');
            alert('输入的内容为:'+result+'。');
        }


    </script>

</head>
<body>
<button onclick="method01()">询问窗口</button>

</body>
</html>